<!-- 继承布局页面 -->
@extends('front.common.header')

<!-- title -->
{{--@section('title', '充电加油')
<!-- 头部导航块 -->
@section('header')
    @parent
@stop--}}
@section('title',$result->name.' - 充电加油')

@section('head')
@parent
@stop


<!-- 中间内容块 -->
@section('content')
<link rel="stylesheet" type="text/css" href="{{ asset('/css/employ/list.css') }}" />
<link href="{{ asset('/css/company/jobs.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('/css/company/comdetails.css') }}" rel="stylesheet" type="text/css">
<!-- <script src="{{ asset('js/stickUp.js')}}"></script> -->
<script type="text/javascript">
	$(function(){
		$('#emp_left_ul').first().css('margin-top','0px');
	})
</script>
<div class="main">
    <div class="content">
        <div class='top-nav'>
    		<ul>
    		  {!! $mianbaoxie !!}
    		</ul>
    	</div>
    </div>
    <div class="employ-list" id="qiehuan">
         <div class="employ-list-left fl">
            <div class="employ-search mb20">
                <div class="employ-info employ-tags">
                    @if(!empty($employTags))
                    @foreach($employTags as $etags)
                    <span class="tags">{{ $etags }}</span>
                    @endforeach
                    @endif
                </div>
                <div class="employ-info employ-title">
                    {{$result->name}}
                </div>
                <div class="employ-info">
                    <div class="employ-info-ext fl">
                        <div class="user-info-avatar fl">
                            <img src="{{ userlogo($result->user_id,'middle') }}" >
                        </div>
                        <div class="user-info-uname ml-20 fl">{{$result->userinfo->name}}</div>
                        <div class="user-info-createtime ml-20 fl">发表于{{$result->created_at}}</div>
                        <div class="user-info-createtime ml-10 fl">|</div>
                        <div class="dropdown user-info-createtime ml-10 fl">
                            <form action="{{url('/reports')}}" method="POST" onsubmit="return checkParam('{{empty($authuser)?0:1}}',this)">
                                {{csrf_field()}}
                                @if($app_table=='tcourse')
                                <input type="hidden" name="app" value="teaches_content">
                                @elseif($app_table=='tcompany')
                                <input type="hidden" name="app" value="teaches_company">
                                @else
                                <input type="hidden" name="app" value="teaches">
                                @endif
                                <input type="hidden" name="app_id" value="{{$result->id}}">
                                <input type="hidden" name="app_url" value="{{Request::getRequestUri()}}">
                                <input type="hidden" name="report_type" value="1">
                                <a href="javascript:void(0)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 举报<span class="caret"></span></a>
                                <ul class="dropdown-menu" aria-labelledby="dLabel">
                                    <li><button type="submit">个人信息举报</button></li>
                                    <li><button type="submit" onclick="$('input[name=report_type]').val(2);">垃圾信息举报</button></li>
                                </ul>
                            </form>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="employ-info-ext fl">
                        <ul>
                            <li class="color-orange">
                                <img src="{{ asset('/images/front/jiuyezhinan/view.png') }}" title="">
                                {{$result->views_num?:0}}
    						</li>
                            <li class="color-orange">
                                <img src="{{ asset('/images/front/jiuyezhinan/pl.png') }}" title="">
    							{{ $result->comments_num?:0}}
    						</li>
                            @if(empty($result->is_collect) || $result->is_collect == 0)
                            <li class="color-gray" id="collect_num">
                                <a href="javascript:void(0);" onclick="toCollect('/member/collect','{{$result->showtype=='teaches'?'teaches_content':'teaches_company'}}','{{$result->id}}','{{ csrf_token()}}','{{empty($authuser)?0:$authuser->id}}')">
                                    <img src="{{ asset('/images/front/heart-no.png') }}" title="收藏" >&nbsp;&nbsp;
                                </a>
                                    <span class="color-gray">{{ $result->attention_num}}</span>
                                
                            </li>
                            @else
                            <li class="color-gray" id="collect_num">
                                <img src="{{ asset('/images/front/jiuyezhinan/red-heart.png') }}" title="收藏">&nbsp;&nbsp;
                                <span>{{ $result->attention_num}}</span>
                            </li>
                            @endif
                            <li class="small">|</li>
                            <div class="bdsharebuttonbox"><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
                            <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":["qzone","tsina","weixin","douban"],"bdPic":"","bdStyle":"1","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
                            <div class="clearfix"></div>
                        </ul>
                    </div>
                    <div class="clearfix"></div>
                </div>
                @if(!empty($smallImg))
                <div class="employ-info small-pic bodertop-213 margin-top-10 boderbottom-dashed">
                    <ul class="clearfix fl">
                        @foreach($smallImg as $key=>$smimg)
    					<li>
    						<img src="{{$smimg}}" width="100" height="63" onclick="goBigStep()" style="cursor: pointer;"/>
							<span class="small-up-num">{{$key+1}}</span>
    					</li>
    					@endforeach
                    </ul>
                    <div class="step-title float-r"><a href="javascript:void(0)" onclick="goBigStep()">分布阅读</a></div>
                </div>
                @endif
                <div class="employ-info text-left">
                    <div class="width-92 mt10">
						<p class="font-14 color-6">{!! $result->description['name'] !!}</p>
						<div>
    					    @if(!empty($result->description['img']))
                            @foreach($result->description['img'] as $desimg)
                            <div class="mt-10"><img src="{{ $desimg }}"/></div>
                            @endforeach
                            @endif
                            <div class="clearfix"></div>
                        </div>
					</div>
					<div class="step-content step-tools">
					    <h2>工具</h2>
					    <ul>
					       @foreach($result->tools as $k=>$tol)
					       <li>
					           <div>{{$tol}}</div>
					       </li>
					       @endforeach
					    </ul>
					    <div class="clearfix"></div>
					</div>
					@if(!empty($result->content) && $isnew ==1 )
					@foreach($result->content as $fkey=>$firstcon)
					<div class="step-content" id="content">
					   <h2>{{$firstcon['title']}}</h2>
						<ul>
						    @foreach($firstcon['content'] as $k=>$con)
							<li id="content_{{$k+1}}">
								<span class="step-content-num" id="icon-num-{{$k+1}}"> {{$k+1}}</span>
								<div class="step-content-main">
									<p>{!! $con['name'] !!}</p>
									@if(!empty($con['img']))
                                    @foreach($con['img'] as $conimg)
                                    <div class="mt-5">
                                        <img src="{{ $conimg }}">
                                    </div>
                                    @endforeach
                                    @endif
								</div>
								@if(count($firstcon['content']) == ($k+1))<span class="cont_end">End</span>@endif
							</li>
							@endforeach
						</ul>
                        <div class="clearfix"></div>
					</div>
					@endforeach
					@else
					<div class="step-content" id="content">
					   <h2>方法</h2>
						<ul>
						    @foreach($result->content as $k=>$con)
							<li id="content_{{$k+1}}">
								<span class="step-content-num"  id="icon-num-{{$k+1}}">{{$k+1}}</span>
								<div class="step-content-main">
									<p>{!! $con['name'] !!}</p>
									@if(!empty($con['img']))
                                    @foreach($con['img'] as $conimg)
                                    <div class="mt-5">
                                        <img src="{{ $conimg }}">
                                    </div>
                                    @endforeach
                                    @endif
								</div>
								@if(count($result->content) == ($k+1))<span class="cont_end">End</span>@endif
							</li>
							@endforeach
						</ul>
                        <div class="clearfix"></div>
					</div>
					@endif
					<div class="step-content step-tools" id="tools">
					    <h2>注意事项</h2>
					    <ul>
					       @foreach($result->notice as $k=>$not)
					       <li>
					           <div>{{$not}}</div>
					       </li>
					       @endforeach
					    </ul>
					    <div class="clearfix"></div>
					</div>
                </div>
<div class="employ-info">
{{--                    <div class="nice-point">
                        <a href="#"><img src="{{ asset('/images/front/jiuyezhinan/good.png') }}"></a>
                        <div class="nice-point-count">445</div>
                    </div>--}}
                </div>

                <div class="employ-info clearfix">
                    <div class="float-l width-50 text-left prev-next">
                    @if(!empty($result->previd)) 
                    上一节：
                    <a href="javascript:void(0)" onclick="toStudy(this,'/teaches/content','{{$result->chapter->teaches->id}}','{{csrf_token()}}','{{$result->previd->id}}')">{{$result->previd->name}}</a>
                    @endif
                    </div>
                    <div class="float-r width-50 text-right prev-next">
                    @if(!empty($result->nextid)) 
                    下一节：
                    <a href="javascript:void(0)" onclick="toStudy(this,'/teaches/content','{{$result->chapter->teaches->id}}','{{csrf_token()}}','{{$result->nextid->id}}')">{{$result->nextid->name}}</a>
                    @endif
                    </div>
                </div>
             </div>
             <div id="com-comments-list">
                 <h4 class="c0 pt15 pb15 pl20 ma0">全部评论</h4>
                 <div id="itemContainer" >
                     @foreach($comments as $k=>$vo)
                     <div class="comment-common" id="comment-common{{$k}}">
                         <div class="comment-user-avatar fl pt10">
                             <img src="{{userlogo($vo->user_id,'middle')}}">
                         </div>
                         <div class="comment-main fl">
                             <div class="comment-content text-left">
                                 <p class="font-20 c3">{{getUserName($vo->user_id)}}</p>
                                 <p class="fs14 c5">{{$vo->content}}</p>
                                 <div class="fs14 c9 ma0">
                                     <div class="fl">
                                         {{$vo->created_at}}&nbsp;&nbsp;&nbsp;&nbsp;
                                         <a href="javascript:;" onclick="showreply({{$vo->comment_id}})">回复</a>
                                     </div>
                                     <div class="fr mr15">
                                         <img src="{{ asset('/images/front/jiuyezhinan/pl.png') }}">
                                         @if(count($vo->childComments)>0)
                                         <input type="text" name="totalnum{{$vo->comment_id}}" value="{{count($vo->childComments)}}" readonly="readonly">
                                         @else
                                         <input type="text" name="totalnum{{$vo->comment_id}}" value="0" readonly="readonly">
                                         @endif
                                     </div>
                                     <div class="clr"></div>
                                 </div>
                             </div>
                             <div id="comment-reply{{$vo->comment_id}}" class="comment-reply-form mt20 dn">
                                 <div class="comment-reply-form-b">
                                     <textarea id="comment-reply-content{{$vo->comment_id}}" class="fl" placeholder="人可以走,留下你的态度"></textarea>
                                     <button type="button" id="submit{{$vo->comment_id}}" class="fr" @if(empty($authuser))onclick="loginTips()" @else onclick="tpushComment('/comment/push?typeid=5','{{$vo->comment_id}}','{{$vo->user_id}}','{{$app_table}}','{{$result->id}}','{{ csrf_token() }}')" @endif>发表回复</button>
                                 </div>
                             </div>
                             <div id="message{{$vo->comment_id}}" class="commentmsg dn"></div>
                             <div class="comment-child text-left" id="comment-childs{{$vo->comment_id}}">
                                 @if(count($vo->childComments)>0)
                                 <div class="comment-caret-up"><i class="glyphicon glyphicon-triangle-top"></i></div>
                                 <div class="comment-child-content" id="comment-child-content{{$vo->comment_id}}">
                                     @foreach($vo->childComments as $key=>$zn)
                                     @if($key<3)
                                     <div class="comment-child-content-list" >
                                         <p class="fs18 color-green">{{$zn->user->name}}：</p>
                                         <p class="fs14 c5">{{$zn->content}}</p>
                                     </div>
                                     @endif
                                     @endforeach
                                 </div>
                                 @endif
                             </div>
                         </div>
                         <div class="clr"></div>
                     </div>
                     @endforeach
                 </div>
 分页

                 <div id="holder" @if(count($comments)== 0) class="holder dn" @else class="holder" @endif></div>
                 <script>
                   jPages();
                 </script>
                <div class="comment-reply-main">
                 <textarea id="comment-reply-content" placeholder="人可以走,留下你的态度"></textarea>
                 <div class="mb20 lh44 mt10">
                     <div id="message" class="fl"></div>
                     <button type="button" class="fr" id="submit-main" @if(empty($authuser))onclick="loginTips()" @else onclick="tcomment('/comment/push?typeid=5','{{$app_table}}','{{$result->id}}','{{ csrf_token() }}')" @endif>发表回复</button>
                 </div>
             </div>
             </div>
         </div>
         <div class="employ-list-right fl">
            <div class="employ-list-tips">
	           <div class="tips-title">相关内训</div>
	           @foreach($teaches_hot as $k=>$thots)
	           <div class="tips-content @if($k>0) bodertop @endif">
	               <div class="tips-content-main">
    	               <div class="tips-content-title"><a href="{{url('/teaches/'.$thots->id)}}">{{ str_limit($thots->name,24)}}</a></div>
    	               <div class="tips-content-views">阅读（ {{ $thots->views_num }} ）</div>
	               </div>
	           </div>
	           @endforeach
	       </div>
	       @foreach ($ads_img as $key => $adimg)
	       <div class="employ-list-tips mt-10">
	           <img src="{{$adimg->attachment($adimg->id)->url}}">
	       </div>
	       @endforeach
         </div>
         <div class="clearfix"></div>
    </div>
    @include('front.teaches.bigstep')
    
</div>
<div class="left-icon-num">
   <ul>
    @foreach($result->content as $kk=>$con)
     <li class="list-icon-link"><a href="#content_{{$kk+1}}">{{$kk+1}}</a></li>
     @endforeach
   </ul>
</div>
<script type="text/javascript">
jQuery(function($) {
    $(document).ready( function() {
      $('.left-icon-num').stickUp({
        parts: {
    	  @foreach($result->content as $kkk=>$con)
          {{$kkk}}:'content_{{$kkk+1}}',
    	  @endforeach
        },
        itemClass: 'list-icon-link',
        itemHover: 'acti',
        topMargin: 'auto',
      });
    });
});
</script>

@endsection
